<<<<<<< HEAD
import Vue from "vue"
import Vuex from "vuex"
import state from './state'
import mutations from './mutations'
Vue.use(Vuex)
export default new Vuex.Store({
  state,
  mutations
})
=======
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    list: [] //总数据
  },
  getters: {},
  mutations: {
    // 添加
    add1(state, title) {
      state.list.push({
        id: new Date().getTime(), //时间戳
        title: title,
        status: false
      })
    },
    // 删除
    remove(state, id) {
      state.list.forEach((item, index) => {
        if (item.id == id) {
          state.list.splice(index, 1)
        }
      })
    }
  },
  actions: {},
  modules: {}
})
>>>>>>> 31a66a540e66d2ea5e63d0d0cbcb50c617fb80eb
